home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 762 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  2.0 KB

  1. Path: sunrise.gv.ssi1.com!news
  2. From: Mike Palmer <Mike.Palmer@tus.ssi1.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Hungarian notation
  5. Date: Sat, 06 Jan 1996 15:23:02 -0800
  6. Organization: Silicon Systems, Inc.
  7. Message-ID: <30EF0456.60A2@tus.ssi1.com>
  8. References: <30C40F77.53B5@swsbbs.com> <4behis$3cl@dux.dundee.ac.uk>
  9.         <RIGOTTI.95Dec29100514@roach.dra.hmg.gb>
  10.         <4cd8fc$oud@news.manawatu.gen.nz> <HtlknJAZAQ7wEwjl@wndrwrks.demon.co.uk> <60KgWmb-3RB@herold.franken.de>
  11. NNTP-Posting-Host: tu155.tus.ssi1.com
  12. Mime-Version: 1.0
  13. Content-Type: text/plain; charset=us-ascii
  14. Content-Transfer-Encoding: 7bit
  15. X-Mailer: Mozilla 2.0b2 (X11; I; HP-UX A.09.05 9000/715)
  16.  
  17. Joachim Durchholz wrote:
  18. > > Consider also that variable names may be misleading anyway. In that
  19. > > sense there's no great difference between
  20. > >
  21. > >         someProc(MyString)
  22. > >
  23. > > and
  24. > >
  25. > >         someProc(pszMyString)
  26. > >
  27. > > either could quite happily refer to any other data type.
  28. > >
  29. > This example does not occur in real life. Or rather, it better should not!
  30. > Anybody using meaningless names like "MyString" should be thrown out of
  31. > the programming business. Depending on the actual semantics of "someProc",
  32. > the parameter should be called "Message" or "Options" or "ParserInput" or
  33. > whatever.
  34. > -Joachim
  35.  
  36. One hopes you just missed the point here. Hungarian notation does not attempt
  37. to help you keep track of _what_ your variable is, it gives you a framework 
  38. to keep track of what _kind_ of variable it is. One would also note that 
  39. someProc is not a very descriptive name, but so what? In the first example, I
  40. have _no_ clue what type of variable MyString is, although I could probably 
  41. deduce that it is a string. In the second example, the prefix tells me that 
  42. it is a Pointer to a Zero terminated String. 
  43.  
  44. -- Mike --
  45.  
  46. ---- Mike Palmer --------------- Mike.Palmer@tus.ssi1.com ----
  47. ----      The opinions expressed here are mine, and       ----
  48. ----         not those of my employer or of TDK.          ----
  49.